<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/struts/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="./style/alternative.css" media="all" rel="stylesheet" />
<script type='text/javascript' src='script/prototype.js'></script>
<script type='text/javascript' src='script/common.js'></script>

<style type="text/css">
#itemForm {
    padding-left:2em;
    padding-top:2em;
}

#itemTab {
    border:2px groove #CCC;
}

#itemTab td{
    padding:2 2 2 2;
    border:1px solid #CCC;
}
#itemName {
	width:30em;
}
#description {
	width:30em;
}
</style>
</head>
<body>
<c:set var="action" value="life.htm" />
<c:choose>
<c:when test="${param.itemType==1}">
<c:set var="title" value="也许会做的事" />
</c:when>
<c:when test="${param.itemType==2}">
<c:set var="title" value="仅作参考" />
</c:when>
<c:when test="${param.itemType==3}">
<c:set var="title" value="健康清单" />
</c:when>
<c:when test="${param.itemType==4}">
<c:set var="title" value="生日清单" />
</c:when>
<c:when test="${param.itemType==5}">
<c:set var="title" value="维修清单" />
</c:when>
<c:when test="${param.itemType==6}">
<c:set var="title" value="假日清单" />
</c:when>
<c:when test="${param.itemType==7}">
<c:set var="title" value="清洁清单" />
</c:when>
<c:when test="${param.itemType==8}">
<c:set var="title" value="幸福感清单" />
</c:when>
<c:otherwise>
<c:set var="title" value="待办事项" />
<c:set var="action" value="item.htm" />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${empty item}">
<c:set var="handler" value="${action}?method=create" />
</c:when>
<c:otherwise>
<c:set var="handler" value="${action}?method=update" />
</c:otherwise>
</c:choose>


<div id="content"><div id="content_inner">
<form name="itemForm" id="itemForm" action="${handler}"  method="post">
<TABLE id="itemTab" class="its" cellspacing="4" cellpadding="4">
<thead>
  <TR>
<TH colspan="2" align="center">
${title}
</TH>
  </TR>
  </thead>
  <TR>
    <TD>事项:</TD>
    <TD>
	<TEXTAREA NAME="itemName" id="itemName" ROWS="1" COLS="100%">${item.itemName}</TEXTAREA>
	</TD>
  </TR>
  <TR>
    <TD>描述:</TD>
    <TD>
	<TEXTAREA NAME="description" id="description" ROWS="8" COLS="100%">${item.description}</TEXTAREA>
	</TD>
  </TR>
  <TR>
    <TD>类别: </TD>
    <TD><SELECT NAME="categoryID" ID="categoryID">
<c:forEach items="${categories}" var="entry">
        <OPTION VALUE="${entry.key}">${entry.value.description}
 </c:forEach>
</SELECT></TD>
  </TR>
  <TR>
    <TD colspan="2" align="center">
    <input type="hidden" name="itemID" id="itemID" value="${item.itemID}">
    <input type="hidden" name="itemType" id="itemType" value="${param.itemType}">
    <INPUT TYPE="submit" value="确认">&nbsp;&nbsp;
	<INPUT TYPE="reset" value="取消" onclick="javascript:history.back()"></TD>
  </TR>
  </TABLE>
</FORM>
<script language="Javascript">
<c:if test="${not empty item}">
var pid = "" + "${item.categoryID}";
toSelect("categoryID",pid);

</c:if>
</script>


</div><!-- content_inner -->
</div><!-- content -->
</body>
</html>